Give the object for the animal an instance variable health, make it 10 for this example.
In the event sheet add system expression: every x seconds, make it 5.
For action behind this every 5 seconds event add: animal object, subtract 1 health.
Now it removes 1 health every 5 seconds.
Give that every 5 seconds event a blank subevent, and add event: animal object, compare value: health = 0
After the compare add actions that goes with your animal object being without health.
As for gaining health, lets add some food when the animal bumps into it, add a food object/sprite.
Add a new event: Animal object is colliding with food object, action: animal object add 1 to health, and another action: destroy food object.
Voila, your animal object looses health every 5 seconds, and can gain health by getting some food.