class RPG::Skill
def variables_cost
/<ITEM_COST\s*(\d+)>/ =~ note ? $1.to_i : 0
end
end
class Game_Actor
alias jsgj_skill_cost_payable? skill_cost_payable?
def skill_cost_payable?(skill)
variables = $game_variables
jsgj_skill_cost_payable?(skill) &&
(!variables || $game_variables > 0 ?(variables))
end
end
class Game_Actor
alias jsgj_pay_skill_cost pay_skill_cost
def pay_skill_cost(skill)
jsgj_pay_skill_cost(skill)
variables = $game_variables[skill.variables_cost]
$game_party.$game_variables -= 1 if variables
end
end