Toggle-Status that allows Double attack but cost MP...help?

Hey there,
as the title said, I'm trying to create a Status that allows your actor to do double attack per turn but drains MP every turn, while active.
Basically, I have this archer character that can active a skill "Double Shot" that gives him a state (Double Shot, as a matter of fact) which allows him to attack twice per turn. In return he lose 10% of his max MP every turn.
I've actually made it to this point, the problem is that I would like to remove the state if the hero doesn't have enough MP. I know it can't be that hard to resolve this, but I couldn't find any tutorial or thread that could help.
Give the state an Action Times+: 100% and Ex-Parameter: MP Regeneration -10% trait, then use the following notetag:

Code:
<Custom Turn End Effect>
  if (target.mp < target.mmp * 0.1) {
    target.removeState(state.id);
  }
</Custom Turn End Effect>

Note that this requires Yanfly's Buffs & States Core.
Nice, thanks for the answer!

Original thread: https://forums.rpgmakerweb.com/threads/toggle-status-that-allows-double-attack-but-cost-mp-help.78235/