Need help making a skill trainer event

I currently have 6 variable based skills (alchemy, smithing, gathering, mining, locking picking, and charisma) that when used in game proc a chance to increase in value (from 1-500). I would like to also add skill trainers that you can pay to raise those variables. It seems simple enough... in theory. I can't seem to get it figured out though.

Basically, it would be an NPC I talk to that would check a certain variable (smithing) and then charge 100 gold + 10 gold per level of the variable to increase said variable by 1 point. When the variable reaches 500 (or maybe a lower number depending on the skill of the trainer) the trainer will say that he cannot train the player any further.

Maybe if anyone has the time they could help me figure this out, it would be greatly appreciated. Thanks.
Make a variable and set its value to 10
Multiply that variable by the variable that stores the smithing level of the character.
Then add 100 to that variable.

That should then be the cost to level up the skill.
Something like this?
1.png


I will need conditional branches to convert the variable into a gold amount then check to see if the player has that much gold before deducting it and raising the smithing skill. I'm not sure how to make that happen. 😳
You will need another variable to store the gold amount of the party then.
With this you can create a conditional branch.

Like so:

hh.png


To get this variable, do this:
Control Variables... -> Select "Game Data" -> Select "Other" -> Select "Gold"
Thanks, that works great!

Original thread: https://forums.rpgmakerweb.com/threads/need-help-making-a-skill-trainer-event.129861/