Override max TP with plugin

In my project I need to replace fixed Value of MaxTP to something more flexible, so I decided "I make a plugin" by looking through all .js files in RMMV I managed to make something may look like plugin...

Code:
/*:
 *
 * @plugindesc This is the simpliest way to change max TP value for actor
 * @author Landazar
 *
 * @help This plugin does not provide plugin commands.
 *
 * @param MAX TP Value
 * @desc e.g this.level * 10 (or even fixed value)
 * Default: 255
 * @default 255
 *
*/

(function() { 
    var parameters = PluginManager.parameters('LJP_maxTP');
    var maxTP = number(parameters['MAX TP Value']);
 
        Game_BattlerBase.prototype.maxTp = function() {
        return maxTP;
    };
})();

I don't know very well JavaScript, but I wish to learn JS. I deducted that in this form after installing plugin my Hero's Max TP value will be 255, but after game launch, his maxTP remains default wich is 100. What went wrong in this code?
Always always open the developer console (press F8 during playtest) when something doesn't work as it should. In this case, it's an uncaught reference error, and the full error message will tell you exactly what it is and where it is.
@Aloe Guvner, I did that, console shows no errors! Except missing font files.
Can confirm. Line 17 reference error: number is not defined. Code is case-sensitive! =P

Also, be sure to save your project after making changes in the Plugin Manager, otherwise it won't register your plugin changes in-game. Play-test forces a save prior to launching, but battle-test doesn't.
No way! Is that all? Ahh sh... Ok, It's working, now If you would guide me, how to use evaluation, mostly to get actor level in formula for max TP, because this._level causes to enemies remain idle (or if you could say, they look like other player mmo was lagged)

Edit:// Nevermind. I'll do it in rpg_manager.js
No way! Is that all? Ahh sh... Ok, It's working, now If you would guide me, how to use evaluation, mostly to get actor level in formula for max TP, because this._level causes to enemies remain idle (or if you could say, they look like other player mmo was lagged)

Edit:// Nevermind. I'll do it in rpg_manager.js
Given your edit I'm not sure if you're still seeking an answer to this? 😅

Evals take a string as the input, so you'll need to change the parameter to String (a.k.a. "text") type and adjust the maxTP function to include the eval. Something like this, maybe?
Code:
Game_BattlerBase.prototype.maxTp = function() {
    return eval(maxTP);
};
About using level in your formula: enemies don't have a _level property by default, so trying to access it will likely just return null (or, at worst, a game crash). If you've got a plugin that adds the property, that should be OK, but otherwise one way around it could be to structure the formula to affect enemies and actors differently, e.g.:
Code:
this.isActor() ? actorFormulaGoesHere : enemyFormulaGoesHere
Lastly you can just use this.level; it's slightly shorter and it's better practice to use these "getter" methods where available. 🙏
@caethyril I tried to do it in rpg_manager.js, but some bug occured so I fixed my plugin with some walkaround.
both methods this._level and this.level are valid, because my TP value on both showed same results, but bug is
that enemies don't attack in SV battles, they just stand.

So I fixed my plugin and I included in return formula $gameVariables.value(id) and in that way I got what I wanted.
But thank you anyway for your effort, I very appreciate it.

Original thread: https://forums.rpgmakerweb.com/threads/override-max-tp-with-plugin.95473/