Is it possible to have a skill costing money?

Hey 😍

I'm thinking about sort of a Mammonita skill, from Ragnarök Online, that costs mp/tp and a few gold pieces. I have Yanfly Battle Engine/Action Sequence 1/2/3 plugins, thought I could make it with common events or something but couldn't figure out how. Any ideas?
I know it is possible, but I dont know how to make the lunatic code.
if you know how to do it, you need to include:

let gold = (code of gold they have)
let value = 30 (or any amount of gold required to cast it)

and some more.
but this should be in before casting the skill that check the amount of gold available.
lunatic code is something many people need help on unless they know JS.

but there are lunatic codes online on the tip and trick on his site.
you can check what is closest what you need, and adjust that part
with the gold adding.
<Custom Execution>
$gameParty.loseGold(1000);
</Custom Execution>

You need Yanfly skill core
Yeah, with a few yanfly plugins, although if you want the player to know the cost, you'd need to put it in the tooltip or something unless you plan on getting some custom plugin to add it to the cost section. The plugin you'll need is YEP_SkillCore (I think?), so:

Code:
<Custom Requirement>
value = $gameParty.gold() >= 12345
</Custom Requirement>
<Custom Execution>
$gameParty.loseGold(12345);
</Custom Execution>

Custom Requirement makes sure you can't use the skill if you don't have enough gold and Custom Execution subtracts the gold cost. Replace the two "12345"s with however much you want it to cost.

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-have-a-skill-costing-money.122322/