Need Script Call to do Conditional check on Party's Gold in comparison to a variable

By default, Conditional Branch options only let you check if your party's gold is either ≥, ≤ or < than a specific number, but doesn't give the option to compare it to a variable. I tried looking through the MZ Script Call list but finding & piecing together the entire script call is like looking for a needle in a haystack & then treading that needle while blind.

Can anyone provide me the script call to conditional check the party's gold to a variable?
You could do:
Control Variables -> Game Data -> Other -> Gold
Conditional Branch -> Variable = Variable

Or you can put in the Conditional Branch Script box:
$gameParty.gold()==$gameVariables.value(X)
where X is the variable ID, no leading zeroes.
I tried looking through the MZ Script Call list but finding & piecing together the entire script call is like looking for a needle in a haystack & then treading that needle while blind.
Just as an FYI for the future, I'll mention that the MZ Script Call list is rarely something that you'll want to use. Instead, you should check out the "RPG Maker MV / MZ Script Calls" sheet. The way that it's organized makes it a lot more suitable for quickly finding answers to these types of questions, and it has actual explanations and code examples.
Or you can put in the Conditional Branch Script box:
$gameParty.gold()==$gameVariables.value(X)
where X is the variable ID, no leading zeroes.
I forgot to mention this but I wanted to do a conditional check if the party's gold was either equal to or greater than ≥ the variable. I see == in that script call, would it need to be changed to check for greater than as well?
Just as an FYI for the future, I'll mention that the MZ Script Call list is rarely something that you'll want to use. Instead, you should check out the "RPG Maker MV / MZ Script Calls" sheet. The way that it's organized makes it a lot more suitable for quickly finding answers to these types of questions, and it has actual explanations and code examples.
I looked at that too, but for conditional branches it didn't show any examples of code, then I went to the MZ exclusive list, wasn't any easier.
I forgot to mention this but I wanted to do a conditional check if the party's gold was either equal to or greater than ≥ the variable. I see == in that script call, would it need to be changed to check for greater than as well?

I looked at that too, but for conditional branches it didn't show any examples of code, then I went to the MZ exclusive list, wasn't any easier.
You'd change it to >=, yeah.
You'd change it to >=, yeah.
I am so happy. I took the advice offered and I have been going through the W3School JS course online. It has only been a few days for a few hours at a time, but I actually knew this answer.

You folks’ advice was spot on. Thanks for that and for your responses to this post!

Original thread: https://forums.rpgmakerweb.com/threads/need-script-call-to-do-conditional-check-on-partys-gold-in-comparison-to-a-variable.154662/