Help with gaining a "stack" on enemy kill?

Hello,

I'm currently working on a class whose premise is that they kill enemies to produce a resource which they then spend on skills - the problem is that I can't get this to work.

I plan to have the resource capped at 5, which would then allow the character to use their ultimate attack provided they have a sufficient amount of "resource". I'm open to using states as a visual indicator to show how much of the resource my character currently posses, although if replacing the TP bar with another that would instead show this resource would also fit well.

The program which I'm using is MV.

Thanks in advance!
I think in the damage formula's you would have to somehow check if the damage kills the enemy. And if it does, it increases the recourse by 1. Not sure how to do that though

Edit: I found what you would need to put in the formula

b.die(); setTp(+1)

It's close to what you want. Just find a script that allows you to give different charecters different amounts of max tp and different TP regains. Hopefully this works

I got the information from this thread
https://forums.rpgmakerweb.com/index.php?threads/damage-formulas-101.81905/
Perfect, thanks! I think I can make a working system with SumRndmDde's TP Upgrade plugin, in case someone else finds this thread in the future.

Edit: I can't seem to get get the desired result using SumRndmDde's plugin. I've heard that a lot of his plugins are either outdated or don't mesh well with Yanfly's plugins. Back to the drawing board 🙁

Also, how would you go about adding the part you wrote up to the damage formula? I'm still a bit new to this, but couldn't you use roughly the same thing you wrote but replace the TP gain part with adding a state?
I think it goes

b.die(); a.setTp(+1); DAMAGE FORMULA

Where DAMAGE FORMULA is something like ((a.atk*2)/(b.def/2))
Tech Support is for when you can't get the engine to run.

Moved to: RPGMaker MV

Original thread: https://forums.rpgmakerweb.com/threads/help-with-gaining-a-stack-on-enemy-kill.115152/