MZ Script code to get skill sp cost on mz?

I would like to get the values of sp/mp of skills to put into a variable.
I think you would have to store the skill being used first:
JavaScript:
let yourVariable = $gameActors._data[yourActorId]._actions[0]._item
Then use that to get the cost:
JavaScript:
let yourOtherVariable = $dataSkills[yourVariable].mpCost

*edit this is untested by the way.
Is there anyway to get directly from database?
Will you know what skill it is, or will it based on what skill is currently being used?

If you know what skill it is you simply have to use:
JavaScript:
let yourVariable = $dataSkills[skillNumberGoesHere].mpCost

To get the cost from the database.

If you need the skill that's currently being used, you have to check that first, then pull the cost based on that check.
Worked! Now i understood! thnk so much!
Of course, it was my pleasure! :LZSjoy:
taking advantage of the situation, do you know a script command for me to put as a condition to only happen if the mouse is over a picture?

Original thread: https://forums.rpgmakerweb.com/threads/script-code-to-get-skill-sp-cost-on-mz.139835/