# Formula for Gaining Yanfly Party Gauge?

#### esterk

##### Lovable Rogue
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?

#### esterk

##### Lovable Rogue
Bumping this to try and get some help with this formula!

#### VeryXInh

##### Veteran
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?

#### esterk

##### Lovable Rogue
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?

### Latest Profile Posts

Just spent \$174 on Shining the Holy Ark on the Saturn. Good lord.
My brain when designing quests:
There is piano, it needs help --> The organ (yes organ now) is missing a component! --> Where the heck am I supposed to put this missing piece!??! --> Add an entire new mini dungeon specifically created to house this new piece. --> Connect this brand new mini dungeon to an already designed dungeon with background information about the town it's found it.

Me:
Rising of the Shield Hero!
Sheesh, Guys, don't think you can throw easy prices like \$25/\$50 on potions/ethers then have monsters pay you \$75 for killing them (never understood that concept btw lol) and think it'll all work out!!! Just realized my prcies vs payout left my players unable to get decent stuff without some serious farming from the start, i'm about to call H&R Block to help my MC get his stimulus check just to buy new armor