Percentage of the hp to apply to any hp amount would be like :
25% = maxhp*0.25
50% = maxhp*0.5
75% = maxhp*0.75
To set animations based on this they would probably be a variable and you check between the values.
So for first animation Is between 75% and 100% = is between maxhp*0.75 and maxhp
second anim = is between maxhp*0.5 and maxhp*0.75
third anim = is between maxhp*0.25 and maxhp*0.5
final anim = less than max hp*0.25
And so you don't have to keep writing formulas you can assign them variables :
var1 = maxhp*0.25
var2= maxhp*0.5 etc