Simple game to illustrate 1 timer, 1 variable, and some small commands.
In my game, you can attack the man - which stops the timer working (because he's dead - obviously) or you can leave the room (in which case, you're safe and out of the room).
Once you get back into the room however, he continues (and I didn't reset the counter because I was a bit lazy and thought he'd be about the same distance still).
I shortened the time to 5 seconds (which can be changed easily) because it's easier to demonstrate with a short time.
You get 5 timer events before he kills you (again, can be changed easily in the timer) - which ends up being about 25 seconds.
It's customizable in the fact you can have MANY people, and each give them special "attack" actions so they do different things when they're attacked (try attacking the cactus!).
So, there ya go, see how that is for you.