How can I have a skill use gold to deal damage.

I have a skill that I want to make where you choose to give up 1-999 gold in order to do that much damage to an enemy or group of enemies but i have no idea how i would go about doing something like that since i only understand basic damage formulas
Use Yanfly Skill Core.
And use theese notetags:
<Custom Requirement>
user._goldCost = 1 + Math.randomInt(99);
if ($gameParty.gold() >= user._goldCost) {
value = true;
} else {
value = false;
}
</Custom Requirement>

<Custom Execution>
user._goldCost = user._goldCost || 0;
$gameParty.loseGold(user._goldCost);
</Custom Execution>

<Cost Display Eval>
user._goldCost = user._goldCost || 0;
var variableId = 1;
var value = user._goldCost;
$gameVariables.setValue(variableId, value);
</Cost Display Eval>

<Custom Cost Display>
\c[4]\v[1]\c[0] Gold
</Custom Cost Display>
It will take a plug-in or getting really creative with events.

Moved to Plug-In Requests

Use Yanfly Skill Core.
And use theese notetags:
<Custom Requirement>
user._goldCost = 1 + Math.randomInt(99);
if ($gameParty.gold() >= user._goldCost) {
value = true;
} else {
value = false;
}
</Custom Requirement>

<Custom Execution>
user._goldCost = user._goldCost || 0;
$gameParty.loseGold(user._goldCost);
</Custom Execution>

<Cost Display Eval>
user._goldCost = user._goldCost || 0;
var variableId = 1;
var value = user._goldCost;
$gameVariables.setValue(variableId, value);
</Cost Display Eval>

<Custom Cost Display>
\c[4]\v[1]\c[0] Gold
</Custom Cost Display>
Thanks for the tips, however when I try to use the skill each time it makes a random amount of gold rather than letting them choose. Am I suppose to input something else? And when i get a chance to use the skill it just skips their turn
@JTK

Oh hold on Ignore what I said in my last post and do this instead.
You still need Yanfly Skill Core.


You need to make 2 skills.
Skill A is the skill the player uses to chose the amount of gold that's going to be used. Skill B is the skill that's going to do the actual damage.

Skill A:
Makes sure that your damage type it's set to none. Then in the notetag box place this:

<Custom Requirement>

value = ($gameParty.gold() > 0);

</Custom Requirement>

<Before Eval>

do {

$gameMessage.setNumberInput(x, 3);

if($gameVariables.value(x) > $gameParty.gold()){

var text = "";

text += "You do not have \\v[x] \\g";

$gameMessage.add(text);

}else{

$gameParty.loseGold($gameVariables.value(x));

}

} while ($gameVariables.value(x) > $gameParty.gold);
</Before Eval>

<After Eval>

user.forceAction(y, -2);

</After Eval>


Where you see the x replace that with the id of a variable that is going to store the amount of gold the player choses to lose.

Then Skill B will be the skill that will deal damage.
In skill B you don't have to do anything but make the damage type "Damage HP" and in the damage box set it to \v[x] where x is the id of the variable from skill A.

And that's how you have a skill that does damage to an enemy based on gold choice.

Now I could be misinterpreting what you want which it could be that what you want is "a skill that will let you set gold to deal damage and then let you have pick a skill that will let you do damage once you've set the gold". If that the case. Let me know in your next response and I can show you how to do that.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-have-a-skill-use-gold-to-deal-damage.95989/