Remembering character actions

 I had an idea for a stamina mechanic that depletes your stamina (TP) as you move, fight, and take damage. I want to run them through a common event that tests for the character's level (if a random number between 1 and 100 is greater than the character's level, they lose 1 TP) after so many steps, after making an attack, and after taking a hit. The problem is getting the common event to recognize the actor that's attacking and getting hit. I'm not even sure if it's possible without a plugin (or if a plugin exists that will handle it).


 also, I'm not great at Javascript so I'm not 100% sure how to phrase the common event either.
This is not a design question, but an implementation question.  It therefore belongs in the Support forum for the engine you are using.


I've moved this thread to RPGMaker MV. Please be sure to post your threads in the correct forum next time. Thank you.
alright, I've tried various implementations of


if (BattleManager.actor.id == 1) {v[9] = 1}; if (BattleManager.actor.id == 2) {v[9] = 2}; if (BattleManager.actor.id == 3) {v[9] = 3}; if (BattleManager.actor.id == 4) {v[9] = 4}; if (BattleManager.actor.id == 5) {v[9] = 5}; if (BattleManager.actor.id == 6) {v[9] = 6}; if (BattleManager.actor.id == 7) {v[9] = 7};


 in both common events and in the damage lines of the skill itself. I'm honestly stumped.

Original thread: https://forums.rpgmakerweb.com/threads/remembering-character-actions.65744/