Formula for Gaining Yanfly Party Gauge?

Hey everyone,

I am currently using Yanfly's Party Gauge plugin (http://yanfly.moe/2016/02/06/yep-67-party-limit-gauge/) in my game. However, I wanted to design a formula so that if a player hits an enemy weakness, they will gain extra party gauge. I believe the correct formula for this is something like

if (b.elementRate(x) > 1) {100 + a.mat * 2 - b.mdf * 2 + $gameParty.gainPartyLimitGaugeIncrement(x); 100} else {100 + a.mat * 2 - b.mdf * 2}

First off - is this correct?

Second off - is there an easier way to do this so that I don't need to put this into EVERY formula box? Perhaps using Yanfly Auto Passive States (http://yanfly.moe/2015/10/17/yep-13-auto-passive-states/) or another plugin that can somehow just make this a passive function?

Any advice is much appreciated! Thanks in advance!
Bumping this to try and get some help with this formula! 🙂
i will explain why no one help you, it's because of this is more complex than you think.
Each enemy can have many elements with different rate, how could one single formula can handle
that much?
i will explain why no one help you, it's because of this is more complex than you think.
Each enemy can have many elements with different rate, how could one single formula can handle
that much?
Could I not just have a passive state for each element using Yanfly's plugin?
If not, is the first formula I posted the easiest way to do this then?
Bumping this again to get more ideas on how I can pull this off.

I also found this: http://yanfly.moe/2016/12/22/tips-t...fantasy-record-keeper-rpg-maker-mv/#more-4351

I'm wondering if something similar could be applied in my game? Passive States definitely seems to be the way to pull off my original idea, I just need help figuring out the math.

Original thread: https://forums.rpgmakerweb.com/threads/formula-for-gaining-yanfly-party-gauge.104220/