Kiel brought up a good point I missed, your timer is probably being restarted every frame since the only check is if health is a certain value. Try adding the alive boolean similar to how they suggested or I'd recommend their second suggestion personally. Having a function to set the health and just check that when they get hurt instead of all the time is better.