Yanfly Skill Learn

Welp here I am finally directly asking for help on that who using variable points to buy stats and skill increases using Yanfly's Skill Learn System. (http://yanfly.moe/2015/11/14/yep-28-skill-learn-system/)

In my quest to try to remember how I'd done it before I tried three codes.

<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 10;
// Increase the parameter by this amount.
user._paramPlus[2] += 1;
// Remove one Growth Point.
$gameVariables.setValue(10, -1);
// Make the user forget the skill.
user.forgetSkill(55);
// Refresh the user.
user.refresh();
</Learn Cost Eval>

Only leads to setting the Variable 10 to negative one.


Then:


<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 10;
// Increase the parameter by this amount.
user._paramPlus[2] += 1;
// Remove one Growth Point.
$gameTemp.reserveCommonEvent(16);
// Make the user forget the skill.
user.forgetSkill(55);
// Refresh the user.
user.refresh();
</Learn Cost Eval>

Lead to nothing which makes sense because I think $gameTemp.reserveCommonEvent(n) might be the wrong code to call up a common event.

Finally the last one which I assumed would do nothing (besides bring up a minor error) anyway (which it did)

<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 10;
// Increase the parameter by this amount.
user._paramPlus[2] += 1;
// Remove one Growth Point.
$gameVariables.value(10) - 1;
// Make the user forget the skill.
user.forgetSkill(55);
// Refresh the user.
user.refresh();
</Learn Cost Eval>


So that leads me to seeking yer help. I know I pulled it off before so there must be a way. Any know what I'm doing wrong?
I'm still not clear as to what you're actually trying to do. What are you trying to accomplish with this code? More clarification is needed.
I'm still not clear as to what you're actually trying to do. What are you trying to accomplish with this code? More clarification is needed.
Everytime a character levels up you gain ten Growth Points.
GrowthPoint2.PNG


But for some reason I can't remember how I tell the game to remove -1 from the variable after purchase. I used to know how, but now I don't.
// Remove one Growth Point.
$gameVariables.setValue(10, -1);
Closest I got is this SETS the Value to Negative 1.

GrowthPoint3.PNG
Oh I see, it'll work like this:

// Remove one Growth Point.
var x = $gameVariables.value(10);
$gameVariables.setValue(10, x-1);
Oh I see, it'll work like this:

// Remove one Growth Point.
var x = $gameVariables.value(10);
$gameVariables.setValue(10, x-1);
It worked, thank you so much! There is another issue involving this kinda stuff that I need to test, but if I run into a problem again ya mind if I message ya so I don't have to create another thread? 😀
Yeah sure. Don't mind at all.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-learn.81924/