Setting Actor and Class stats to be the solution to a formula containing variables

Does anybody know how to make an actor's and class's Stats (MHP, MMP, Atk, Def, etc...)  follow a formula containing variables rather than a parameter curve in RMMV?


I have tried using Yanfly's Base Parameter Control and Class base parameters plugins to achieve this but I always get this error whenever I try accessing the menu or entering battle if I use $gameVariables[X], $gameVariables.value(x) twice, or V[x] to reference a variable: 


"Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D':float parameter 3 is non-finite." If I use $gameVariables.value(x), it outputs 9999 as my value (MHP in this instance).
​


If I use $gameVariables.value(x), the output is 9999
​


Example of what I want:


Formula - MHP = $gameVariables.value(2) / $gameVariables.value(1)


Result - (lvl 1, 6 MHP) (lvl 2, 7 MHP) etc...


Example of what I DON'T Want


Parameter Curve - MHP= 1,2,4,8,16,etc...


If anybody has any advice to give me, it will be well appreciated.


P.S. If you know how to do this in RMVXA without using script, any suggestions are welcome.


If this is doable using Yanflys plugins, instructions on how to properly use variables in a formula would be very helpful.


Thanks in advance!
can you please tell us where you're placing those formulae?


If I remember correctly, the game variables are not defined until some point after "new game", and if you try to access them before that point, then that might throw a similiar error or get them to display random numbers.
Yanflys "class max parameters" plugin uses a formula to determine a base parameter if the formula (f) is put in a classes notebox like this:


<Custom Class Parameters>


Stat(MHP,MMP,atk,mat,def,mdf,agil,luk or exp) = f


<Custom Class Parameters>


I realize the plugin doesn't have support for individual actors, but if anyone knows how to do this for classes and individual actors, I would be grateful for the assistance.

Original thread: https://forums.rpgmakerweb.com/threads/setting-actor-and-class-stats-to-be-the-solution-to-a-formula-containing-variables.67319/