I usually create a healthbar sprite...
Then add a varaible.
Healthbar = 100
Then in events something like this.
This set the healthbar sprite with to the Healthbar Variable which is 100, Using EveryTick to check this all the time.
EveryTick
Healthbar Sprite width = Healthbar
Then the next bit deducts 1 from the heathbar variable when ever you collide with an enemy, Which in turn makes the Healthbar Graphic/Sprite Smaller.
PlayerSprite OnCollision with EnemySprite
Healthbar = Healthbar -1