RPG hp bar

OK, I am developing a RPG game that, of course, has an HP bar in it. I have made it so that the hp bar will adjust propperly to the Characters health (for example, if the character has 40 out of 50 hp, the hp bar will be 80% full). And when the enemy attacks the character, the hap bar will decrease. But here is my challenge: How could I make the hp bar move when the character (or enemy) has been hit? For example, like a preloader progress bar: You are able to see the progress bar continue to grow over a period of time. I want to do this with the HP bar. So when the character is hit by an enemy, you can see/watch the hp get smaller/shrink, not just suddenly change. Does this make sense? I have no idea where to start AS on something like this. I would appreciate any help or response, thanks.