Rpg maker MV Turning Damage Taken into "resource"

Hello everyone, and thank you for taking the time to view my problem, my knowledge of Javascript is very bad
and I would require some help.
I am planing a game with multiple classes and one of these classes would be a warrior that uses rage when he does damage and when he receives it as well
throughout the help of the forums, youtube, and some face bashing on the keyboard, I was able to do most of the things i have wanted for my class and also learn a bit about how JS code looks in structure
I now need your help with how to make it so that when my character of that specific class takes damage than 10% of the damage taken after damage reduction would turn into rage.

so if a mob hits my hero for 100 damage and the heroes overall damage reduction is 50 I would take the 50 damage to health and gain 5 rage aswell.
I thank you for your time and effort any hint on how I can address the problem will be welcomed
pretty sure you can do this using Yanfly's enhanced TP, although idk how much tinkering with it would be necessary. http://www.yanfly.moe/wiki/Enhanced_TP_(YEP)
Hi Zero, thanks I was not aware of that plugin from the video it does look as if it is just what i needed
You can do that even without a plugin because that is what TP is used for in general.
Also I admit that the plugin make handling TP easier.

All actors receive TP on being damaged, and there is a trait (SP-Parameter TP Charge Rate) that increases or decreases the amount an actor receives from damage.

Without a plugin you can't set formulae and have to go with simple percentage calculations, but that might be enough.
And even if you go the plugin route you'll need this as a reminder to set that trait to zero for those actors that are not supposed to gain rage, because they will do so by default unless you set it to zero by trait.
You can do that even without a plugin because that is what TP is used for in general.
Also I admit that the plugin make handling TP easier.

All actors receive TP on being damaged, and there is a trait (SP-Parameter TP Charge Rate) that increases or decreases the amount an actor receives from damage.

Without a plugin you can't set formulae and have to go with simple percentage calculations, but that might be enough.
And even if you go the plugin route you'll need this as a reminder to set that trait to zero for those actors that are not supposed to gain rage, because they will do so by default unless you set it to zero by trait.
Aye i am now looking into the plugin and my biggest problem with it, or should i say in general is that i am not aware of simply how to write JS code but with time im sure i can handle it.

Edit:
Ok so I am having a bit of problem with the plug-in hoping i might get a solution
So I have set my Enhancer TP with a Mode that gives the hero TP when he does Damage and Receives Damage
the problem is i don't want the player to get TP when he uses a skill that costs TP but because he does damage with that skill he gets TP back, anyway I can counter this?

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-mv-turning-damage-taken-into-resource.117393/