MV Actively increase Max TP with Yanfly Enhanced TP

Hello, I'm aware that you can edit the Max Starting TP and add formulas, but is there any way to reference state counters? I keep getting NaN when I attempt to add this to the Max Tp formula in Yanfy's Enhanced TP:

125+(a.getStateCounter(705)*5)

but perhaps I just didn't write the formula correctly. I'd like each kill to grant 5 Max fury up to 15 stacks, ending after 8 turns.
I don't see anything in getStateCounter() that will make it return 0 if you don't have any stacks.

So if you don't have that state with stacks, it's going to return undefined, which will make the entire formula evaluate to NaN.

You'd need to do something like:
Code:
125+ a.getStateCounter(705) ? a.getStateCounter(705)*5 : 0
I don't see anything in getStateCounter() that will make it return 0 if you don't have any stacks.

So if you don't have that state with stacks, it's going to return undefined, which will make the entire formula evaluate to NaN.

You'd need to do something like:
Code:
125+ a.getStateCounter(705) ? a.getStateCounter(705)*5 : 0
When I use this formula it just defaults the max tp to 0, whether there is prexisting tp or not.
Do you have Buffs & States in your project? Have you checked all Yanfly plugins are in the correct order according to the list on the Yanfly Engine Web site?

Copy the formula, press F8 in the game, go to the Console tab, paste it in and hit Enter - what does it say?
Do you have Buffs & States in your project? Have you checked all Yanfly plugins are in the correct order according to the list on the Yanfly Engine Web site?

Copy the formula, press F8 in the game, go to the Console tab, paste it in and hit Enter - what does it say?
Uncaught TypeError: a.getStateCounter is not a function
at <anonymous>:1:8
A while back I did sort all the yanfly plugins according to the website. I don't think I moved any of them around besides adding some non-yanfly ones to the very bottom.
Heh, yeah, that would be the thing outside of the plugin.

Sorry, do this first:
Code:
var a=$gameActors.actor(X);
replace X with the ID of the actor you're testing on (no leading zeros).

Then paste in the equation and see what you get.

Original thread: https://forums.rpgmakerweb.com/threads/actively-increase-max-tp-with-yanfly-enhanced-tp.159784/