Calling Actor Level in Class Notetag

I'm using both of the following plugins:

VisuStella's Enhanced TP System
Sum Random Dude's TP Upgrade

in order to make TP into "AP" which functions as a secondary MP bar for non-magical abilities. The second plugin allows me to set the max TP value per class via notetags on classes. However, I want to use actor level in my formula so that max TP goes up as the character levels up. How do I call actor level in the class notetag?
Try actor.level and see if that works in whatever formula you plan to use.
That's what I have now and it returns as "NaN". Here's my current formula/notetag:

<Max TP: Math.round(((479/9800) * actor.level * actor.level) + (5 * actor.level) + (244521/9800))>

The numbers are from the formula the base game uses for stat curves. Anyways, I tried to do just actor.level instead of the formula and actor.level by itself does not return a number either.
From the plugin documentation (it's actually the very first thing 🤣):
* Sets the base Max TP of the Actor to 'value'.
* Value can be a JavaScript eval.
*
* Examples: ... <Max TP: this.level * 2>
This is why going over plugin documentation is important. This is especially so for VS plugins, because there is a lot of info there that can be easily missed if you skim it.
Since it was in fact the first thing in the documentation it was the first thing I tried. this.level doesn't work either.
Ah, you didn't say that before.

Do you have reason to believe the SRD plugin will work? It's written for MV, not MZ, so the place in the code that's reading the notetags may be different and not referencing the same "this".
Ah, if it's written for MV it may be as simple as it won't work, period. If anyone knows of any alternative plugins or even solutions with just the VS plugin, I'm all ears.
Ah, if it's written for MV it may be as simple as it won't work, period. If anyone knows of any alternative plugins or even solutions with just the VS plugin, I'm all ears.
Hey mate, I messed around with VS enhanced TP plugin and got it to work but in a very "shady" way. What I did was go to TP modes in the plugin parameters and set the maximum TP formula like this:
image.png


Then, I used the notetag <TP Mode: Stoic> (which was the mode I put this formula) and it kinda worked. I did a battle test and set Gale's level to 1 and this was the result:


image.png



The problem is, my console log started spamming this error right here:

image.png



I didn't notice frame rates dropping but, this may affect the game in the long run. I'm not sure.

So, if you want to test this code and try to alter it, go ahead but, I'm a complete noob at js so, I don't know what I am doing with this code, if you still want to give it a shot, go ahead.

(Another thing to take in consideration is that this is exclusive to gale, you can add many TP modes and set each one with different actor ID's and assign each of them with a different mode. But, I don't think that is a very effective way to work around this.)
You can use the following notetag to set the maximum TP for a class based on the actor's level:

Code:
<Custom TP Max: level * x>

Replace "x" with the value you want to multiply the actor's level by. For example, if you want the maximum TP to increase by 5 for every level the actor gains, you would use:

Code:
<Custom TP Max: level * 5>

You can also use other variables and formulas in this notetag. For example, you could use the following notetag to set the maximum TP to a value equal to the actor's level multiplied by 10, plus 50:

Code:
<Custom TP Max: level * 10 + 50>

This notetag will only work if you are using both the VisuStella's Enhanced TP System and Sum Random Dude's TP Upgrade plugins.
After some experimenting, I think I have it working dandy! For anybody else who may look at this, the final notetag I needed to use on a class is this:

<Max TP: Math.round((((999 - 30 - (98 * 10)) / 9800) * this.level * this.level) + (10 * this.level) + (((9801 * 30) - 999 - (9702 * 10)) / 9800))>

The 999 is what I used for the final value of the parameter at level 99.
The 30 is the initial value of the parameter at level 1.
The 10 is making the curve linear; this number can be replaced by any integer from 0 to 20, and it controls the "growth type" from slow to fast, 0 being slow and 20 being fast.

Original thread: https://forums.rpgmakerweb.com/threads/calling-actor-level-in-class-notetag.153380/