Script that keeps track of damage dealt to the player.

Hello all, I have run into a snafu that I'm curious if anyone has an idea on how to implement this:

Essentially, I wish to have a parallel event that runs continuously during the game that uses a conditional branch that keeps track of the player when playing as the protagonist. I want to have a variable run a check every 30 seconds to determine if the protagonist's health is at or below 75%. For every 30 seconds that pass and the protagonist's health is at 75% or lower, 5 points is added to a common event that can dictate certain situations that happen later. I want it to be that if the protagonist's health is above 75% during this check, 1 point is added to the contrary of the common event that is keeping track of lowered maximum health... sorry if that is confusing.

Think of it like a system similar to how Silent Hill 2 keeps track of the player's health to determine endings... idk I've fiddled with the variable selections and tried to write up the event but I can't seem to properly write out the script needed to fulfill this.

If anyone has any feedback on this I'd appreciate it.
Like this? http://www.yanfly.moe/wiki/Battle_Statistics_(YEP)

This plugin seems to be a statistical function? What he wants is variable logging tracking? Also, I forgot to thank you for your help last time.
Yea, I should've elaborated. My intention was that maybe he could use that built-in statistical function to extrapolate his variable since half the work is now done for him thx to the plugin.

Edit: On second thought, OP wants to check % of Max HP instead of a hard value of damage received, which actually seems easier. It would just be an if conditional that checked MaxHp.
Yea, I should've elaborated. My intention was that maybe he could use that built-in statistical function to extrapolate his variable since half the work is now done for him thx to the plugin.

Edit: On second thought, OP wants to check % of Max HP instead of a hard value of damage received, which actually seems easier. It would just be an if conditional that checked MaxHp.
That seems like a great idea! I'll get the plugin and see if i can find the proper scripts for writing the event i plan, otherwise if it came to it i could potentially just have the events trigger based on the numbers that are being tracked anyways.
Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/script-that-keeps-track-of-damage-dealt-to-the-player.124386/