Yanfly Skill Cost Question

So I watched the Stat Upgrade video and have that working great. The question is making the Skill Cost go up with each purchase so the player can't just farm the same monsters over and over getting god-like power because it all costs the same. I went through the plugin looking for the variable. learnCostJp was the variable I think it might be. I just don't know for sure if it is and what code to put with it.
I've moved this thread to JS Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.


You could also have just posted it in Yanfly's plugin thread.
@Mortalis 


Your thread seems quite old so I'm not sure if you have resolved it or not. I wrote the below notes to achieve something to what you want, it doesn't work perfectly as there is an issue with it where if one actor price is visually displayed on every actor skill, however after the actor makes a purchase it refreshes and shows the correct value and the correct JP is taken from the actor. Maybe you can use this as an example to get what you want to work.


<Learn Cost Eval>


var id = user._actorId;


if (user._actorId == 1) {


$gameVariables.setValue(161, ($gameVariables.value(161)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(161)/3));


}


if (user._actorId == 2) {


$gameVariables.setValue(181, ($gameVariables.value(181)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(181)/3));


}


if (user._actorId == 3) {


$gameVariables.setValue(201, ($gameVariables.value(201)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(201)/3));


}


if (user._actorId == 4) {


$gameVariables.setValue(221, ($gameVariables.value(221)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(221)/3));


}


if (user._actorId == 5) {


$gameVariables.setValue(241, ($gameVariables.value(241)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(241)/3));


}


if (user._actorId == 6) {


$gameVariables.setValue(261, ($gameVariables.value(261)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(261)/3));


}


if (user._actorId == 7) {


$gameVariables.setValue(281, ($gameVariables.value(281)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(281)/3));


}


if (user._actorId == 8) {


$gameVariables.setValue(301, ($gameVariables.value(301)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(301)/3));


}


if (user._actorId == 9) {


$gameVariables.setValue(321, ($gameVariables.value(321)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(321)/3));


}


if (user._actorId == 10) {


$gameVariables.setValue(341, ($gameVariables.value(341)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(341)/3));


}


if (user._actorId == 11) {


$gameVariables.setValue(361, ($gameVariables.value(361)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(361)/3));


}


if (user._actorId == 12) {


$gameVariables.setValue(381, ($gameVariables.value(381)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(381)/3));


}


if (user._actorId == 13) {


$gameVariables.setValue(401, ($gameVariables.value(401)) + 1);


user.refresh();


skill.learnCostJp = Math.ceil((5+$gameVariables.value(401)/3));


}


user._paramPlus[0] += 5;


user.forgetSkill(594);


user.refresh();


</Learn Cost Eval>

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-cost-question.52097/