I need help with loops?

i dont want you to have to press anything i want it to auto regenerate, my end goal is “i want it to be if health drops below 100% wait 5 seconds and start healing 1% every .25 seconds, but if damage is taken while regenerating, stop and wait another 5 seconds to start regenerating… if health = 100% stop regenerating”