What I’ve done similar to what you mentioned is create a health bar sprite of 3 frames. Frame 0 Has 3 Full Red Hearts. Frame 1 has 2 full red hearts. Frame 2 has 1 and frame 3 has blank or no hearts.
Then set Frame Speed to 0 so the animation doesn’t cycle through.
In the Event Sheet, I created a Global Variable calling it Health.
An Event was created that when I got attacked or set to is Flashing I subtracted 1 from the Health Global variable.
The next event I set the Compare Value.
If (Global variable) Health = 3 - Add action: Set the Health sprite Frame to 0
Then created repeating events:
If Health = 2 set Health sprite Frame to 1
Health = 1 set sprite frame to 2
Health = 0 set sprite frame to 3
If Health = 0 add action: Restart Layout or whatever you intend to do.