Variable Skill Cost

I am trying to make a skill requires PP more like Pokemon my game just have 20 skills so what I am doing is setting a variable for each skill so can someone help me with that to set custom requirement of variable in skill and show that variable but I know it can be done by Skill core but I don't know how

Edit-:
I have done almost everything but I don't know how to subtract variable in script this is last thing left please help me with it
All of these codes require Yanfly Skill Core + the Core and battle engine I believe? You'll need to slap these codes into your skills and tweak as needed.

This first code is the requirement itself:

<Custom Requirement>
if ($gameVariables.value(x) >= 1) {
value = true;
} else {
value = false;
}
</Custom Requirement>

This one reduces the variable by X when this skill is used:

<Custom Execution>
$gameVariables.setValue(X, $gameVariables.value(X) - 1);
</Custom Execution>

This last one shows the "custom cost" of the skill. You can use all sorts of codes to show icons, change the text color, etc.
<Custom Cost Display>
\v[X]
</Custom Cost Display>

Make sure you initialize the variable somewhere (beginning of battle or whatever) and set it to whatever amount of "pp" you wanted.
@Fernyfer775 Thanks for your code My code before this was

Code:
<Custom Show Eval>

if ($gameVariables.value(12) < 1) {

visible = false;

} else {

visible = true;

}

</Custom Show Eval>


<Custom Cost Display>

\c[4]\v[12]\c[0] SP

</Custom Cost Display>
and I was calling a common event for decreasing variable

Now my code is this
Code:
<Custom Show Eval>
if ($gameVariables.value(12) < 1) {
visible = false;
} else {
visible = true;
}
</Custom Show Eval>

<Custom Execution>
$gameVariables.setValue(12, $gameVariables.value(12) - 1);
</Custom Execution>

<Custom Cost Display>
\c[4]\v[12]\c[0] SP
</Custom Cost Display>

Again thanks now I don't have to use Common events for every skill in my game
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/variable-skill-cost.103688/