MZ Using MP when Dashing

Hello! Firts, sorry for my poor english.
Second, im making a game where im using MP like "stamina" (when the char shot an arrow loses mp, for example, and mp is recovering over time), but i need to when my char dash he loses MP, is this possible? Is there some plugin to do that? If my calculations are correct (mcfly), i need -1MP every 4 steps dashing (im using cyclone movement, so 4 steps is one tile).
One option is event commands, e.g. something vaguely like what I described in this thread:
You can use Control Variables -> Game Data -> Actor -> MP to get an actor's MP, and Change MP to change it when appropriate.

I know of this plugin for RMMV:
I'm not sure how compatible it is with MZ, though, and I think you'd still have to manually tie the stamina value to the MP of the appropriate actor. There may be alternatives~
Oh, thank u @caethyril! I will try the two options!
Im not good in js and really need to learn, but i thinked something like a Common event runing in paralel and checking If the player is running -> counting 4 steps -> changing mp, but i stopped in the first barrier that's check running as a conditional

Original thread: https://forums.rpgmakerweb.com/threads/using-mp-when-dashing.142108/