Stat purchase at level up

Hi, new guy here.  I just found the script to increase stats with JP. But I was wondering if someone could help me with a script to increase the cost of each stat purchase.


For example, increasing Attack the 1st time costs 500 increasing it the 2nd costs 1000 and so on. 


I'm using this script published by Yanfly on one of his videos;


<Learn Cost: 500 JP>


<Learn Cost Eval>


user._paramplus[0]+=500;


user.forgetskill(21);


user.refresh();


</learn Cost Eval>


here skill 21 is a dummy skill that increases a stat permanently and cannot be seen in battle or skill menus.


In case anyone was looking for the video, here it is;

Original thread: https://forums.rpgmakerweb.com/threads/stat-purchase-at-level-up.61838/