Not trying too hard to stray from the topic and just convey my point on one post, the math behind health bars is easy: You get the x position and the max length of the health bar, and then you divide the max length by the max HP and then multiply that result by the HP you already have. That gets you an interpolated value between the x position and the maximum length which you can use as either the xscale of a 1px long sprite OR just the rightwards coordinate in a rectangle.
tl;dr:
xdist=maxLength/maxHP*HP;
paired with
make_rectangle(x,y,x+xdist,y+anything);
OR
draw_sprite_ext(sprHealthBar,0,x,y,xdist,1,0,c_white,1);
And you can combine this with the code from before to get a working healthbar which is based on a global.HP variable or so-so. I hope you understand.