mob/proc/check()
if(src.type == /mob/Player)
var/fHP = (HP / MaxHP) * 100
var/meterHP
if (fHP < 100&&fHP > 89)
meterHP = 90
else if (fHP == 0)
meterHP = 0
else if (fHP == 100)
meterHP = 100
else if (fHP <= 10&&fHP != 0)
meterHP = 110
else if (fHP > 100)
meterHP = 120
else
meterHP = (round(fHP) - 5)
if (((meterHP / 5) % 2) == 1)
meterHP += 1
meterHP = round(meterHP,10)
for(var/obj/HP/P in src.overlays)
P.icon_state = "power_[num2text(meterHP)]"
//check for stat caps
if (src.Strength > 1000000) //max 100 million
src.Strength = 1000000
if (MaxHP > 1000000000) //max 1 billion
MaxHP = 1000000000
if(HP < 0) HP = 0
Problem description:Nothing happens.
What you can do is instead have a seperate list and/or variable to keep track of what you have in the overlays list. Then when you want to make a change, remove the changed item from overlays(using the seperate list/var you have), change the object in that list or var, and then re-add it to the overlays list.
Also, instead of if(src.type == /mob/Player), you might want to use istype(). istype() will still work for subtypes, so src.type could be /mob/Player/Knight and it would still work.