Well, if it is server side, you could just call the function inside the playerdamage function after damage has been dealt ect.
If i is client-side, you could do a hp check, and if it decreases, call the function..
Unless you are specific, I can't really give you an answer.
You could actually put a do-while loop without causing much lag.. It just depends on what you want.