Conditional branch Pay gold = to variable?

Is there any way to if/than pay gold based on a variable? I'm working on making it so you can buy an item for x amount of money based on a variable, every time you buy said item it increases the variable, thus making it more expensive.

1746124424069.png

In this image, you can see when you buy it, it charges you the gold based off of the Variable, then it increases the variable by +1 and then by x2. However, I want an if statement for Gold. I need to make sure they can buy the item and can afford it based off of the variable. However, I do not know how to go about making it check to see if you have enough gold based off of the variable.
You use script in condition and search for something like gameparty.gold its in my script call list found in signature. I’m not in pc right now but hopefully it helps!

Also a sample here
Maybe this works as a Script in the Conditional Branch?

JavaScript:
$gameParty.gold() >= $gameVariables.value(2)
Make another Variable called "current gold" that holds the party's gold amount, and then use this one inside your check.
Maybe this works as a Script in the Conditional Branch?

JavaScript:
$gameParty.gold() >= $gameVariables.value(2)
This works like a charm! Thank you so much! :3
here is a very [nice demo] for it, keep in mind, the method
used here = MP that increases the amount, so you could convert it to GOLD
if you like, which you probably track first, every time, so it increases correctly.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-pay-gold-to-variable.177349/