MV Leave State all allies effect (YanFly plugins)

I couldn't find anywhere a script call or smth like this for YanFly's Lunatic Mode so asking here.

There is a skill which applies a state to a user with some effects only for this user. But after state expires, it should restore MP to all allies.

I have this code:
Code:
<Custom Leave Effect>
var mpheal = 2;
user.gainMp(+mpheal );
</Custom Leave Effect>
And I just need to replace user.gainMp. What should be here?
I tried to use some tags from MV/MZ Script Call table (allMembers, aliveMembers, etc), but nothing works.
This thread was moved from RPG Maker MV Support to Javascript/Plugin Support.
And I just need to replace user.gainMp
Code:
user.friendsUnit().aliveMembers().forEach(member => member.gainMp(mpheal));
Code:
user.friendsUnit().aliveMembers().forEach(member => member.gainMp(mpheal));
Works. Big thanks!

Original thread: https://forums.rpgmakerweb.com/threads/leave-state-all-allies-effect-yanfly-plugins.177953/