Yanfly Skill Learn System: Gradual JP Cost Increase

Is there a way to make an actor's learnable skills cost more JP the more skills they learn?
I got the idea from Octopath Traveller and it's something I'm thinking about adding to my game, as it adds a bit of freedom to the game.
Is there a way to do this without editing the plugin itself?
Spoiler: Example
OTSkillLearn.PNG
EDIT: I may have an idea of what to do for this, but the solution I came up with doesn't actually seem to work.
It's in my next reply (No need to post it twice).


Watch this video and it should give an idea of how to accomplish this.
So, I've looked into it and I think I've found a solution to this, though I'm not entirely sure.
Can anyone tell me if this code being in a skill's notebox would work?
Spoiler: Skill Notebox
<Learn Cost Eval>
if ($gameVariables.value(4) = 50) { $gameVariables.setValue(4, 100); } else { if ($gameVariables.value(4) = 100) { $gameVariables.setValue(4, 300); } else { if ($gameVariables.value(4) = 300) { $gameVariables.setValue(4, 600); } else { if ($gameVariables.value(4) = 600) { $gameVariables.setValue(4, 1200); } else { if ($gameVariables.value(4) = 1200) { $gameVariables.setValue(4, 2000); } else { } } } } }
</Learn Cost Eval>

<Custom Learn JP Cost>
cost = $gameVariables.value(4)
</Custom Learn JP Cost>
Basically, I have it so if a certain variable (Each actor would have one) is at a certain number (50), it would increase it to a number equal to the next JP cost (100) and I set the cost to equal that variable, so it always updates the rest of the actors learnable skills.
At least, that's what I was going for.
If you're going to use variables for this, the current approach can be refined. I would try this:

<Learn Cost Eval>
if ($gameVariables.value(4) = 50) {
$gameVariables.setValue(4, 100);
} else if ($gameVariables.value(4) = 100) {
$gameVariables.setValue(4, 300);
} else if... {

}
</Learn Cost Eval>

<Custom Learn JP Cost>
cost = $gameVariables.value(4);
</Custom Learn JP Cost>

Repeat the else if part in the Learn Cost Eval as needed. Then at the end, it's just the final bracket with no else.
If you're going to use variables for this, the current approach can be refined. I would try this:

<Learn Cost Eval>
if ($gameVariables.value(4) = 50) {
$gameVariables.setValue(4, 100);
} else if ($gameVariables.value(4) = 100) {
$gameVariables.setValue(4, 300);
} else if... {

}
</Learn Cost Eval>

<Custom Learn JP Cost>
cost = $gameVariables.value(4);
</Custom Learn JP Cost>

Repeat the else if part in the Learn Cost Eval as needed. Then at the end, it's just the final bracket with no else.
I tried this, but it ended up giving me this error (Also, for testing purposes, I used variable 10 instead of 4).
Spoiler: Error
Error.PNG
Also, here's how I wrote out the rest of the code.
Spoiler: Code
Code.PNG
One other thing, the costs start as 75 for some reason.
My mistake. Each equal sign should be this:

if ($gameVariables.value(4) === 50)

If statements need 3 equal signs to make the check.
My mistake. Each equal sign should be this:

if ($gameVariables.value(4) === 50)

If statements need 3 equal signs to make the check.
It works perfectly now! Thanks, Shockra!
😀
Spoiler: Image of functioning system
JPCostIncrease.png
Also, it was defaulting to 75 because I had the default JP set to 25.
How would one code it so that skill learn costs doubled each time an actor learned a skill?

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-learn-system-gradual-jp-cost-increase.98396/