Damage formula question

Hi!


I've been making up some new skills, but there's one skill idea of which I'm not sure how to do.


Basically, I have a skill that randomly attacks foes, but the amount of attacks is determined by the users' mana. Each 20% mana is one hit, so 100% of mana should amount to 5 hits. How would I code that?
I don't think you can do this from the damage formula, because the scope i.e. how many times a hit is made, is calculated elsewhere.

What you might be able to do is to use the skill to call up a common event

That CE runs a conditional, so that at 100% MP it does forced action x 5 on another (hidden from the player) skill which actually does the damage.

At 80% MP it does forced action x 4

etc.

EDIT

Hmm,

having said that you can't do it from the damage formula, it might be possible to make a snippet for a custom_skill_name which does all of that and then use the damage formula to apply the custom_skill, but I'm not sure of the coding for the snippet.
Am not a very big fan of Forced Action thingies. I've been using custom_skill_formula for other formula's, yes, but I'm not sure how to determine the % of mp and then the amount of hits. 😛
Maybe ask in the script call section?  Or the thread 'Ruby questions that don't deserve their own thread' might be the one?
Bump, still looking for an answer.

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-question.44922/