How to add variables into attack damage formulas?

Probably a frequently asked question, but I was unable to find one.

To prevent a lot of pointless reading just in case:
I know in VX Ace you could do, for example "$game_variables[6]" for it, does this same thing still work on MV or no? If so, is that what I use?

If not, topic.
There's a gun-wielding character who deals almost 2x more damage than anybody else, and I figured I would add ammo to her to force a reload every so often(how often is based on skill usage) to try and add some balance to her. So, here's how the ammo reserves on her best skill would work:
Everything's ran through common events, and the variable starts every match at 10, and with each skill, the variable either drops by 1, 3, 5, or everything that's left.
So the formula for her strongest ability would be (variable) * a.atk - b.def ; But it's unusable if your ammo count is at 0.
How would I add the variable to the formula?
You can substitute a variable value in a damage formula by writing v[variable number].
You can substitute a variable value in a damage formula by writing v[variable number].
Greatly appreciated. Thank you.
Small addition:
If you use a variable in your damage formula this way, you should make sure that variable was set at least once in your playthrough and thus properly initialized (if unsure, setting your variable to 0 when you start a new game should suffice). Otherwise the formula might fail and result in 0 damage.

This is because the game initializes variables as needed, and using v[x] within your damage formula bypasses the checks usually done when accessing a game variable.

Edit: After reading over the initial post again the warning above might not be applicable here... May be still worth mentioning. =)
Dumb question. Do you use the brackets with that? Or just V and the number. So V[4] or V4?
Small addition:
If you use a variable in your damage formula this way, you should make sure that variable was set at least once in your playthrough and thus properly initialized (if unsure, setting your variable to 0 when you start a new game should suffice). Otherwise the formula might fail and result in 0 damage.

This is because the game initializes variables as needed, and using v[x] within your damage formula bypasses the checks usually done when accessing a game variable.

Edit: After reading over the initial post again the warning above might not be applicable here... May be still worth mentioning. =)

Yeah, it automatically sets it before fights, so I'm good 😀

Dumb question. Do you use the brackets with that? Or just V and the number. So V[4] or V4?
v[4]

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-variables-into-attack-damage-formulas.89903/