YEP_ExtraParamFormula - Hit rate formula (ATK or MAT or Both)

Hello there. I'm curious about the Hit rate formula from Yanfly's Extra Param Formula: http://yanfly.moe/2016/02/12/yep-69-extra-parameter-formula/

I have certain actors that possess:
-A Strength (ATK) stat, but no Magic (MAT) stat.
-A Magic (MAT) but no Strength (ATK).
-Both Strength (ATK) and Magic (MAT).


The Hit rate formula I'm using is: (base + plus) * rate + flat + ((user.atk + user.agi) / 2000), but for the actors that don't have a magic stat, they would be at a disadvantage against those who have Strength.

If the formula was: (base + plus) * rate + flat + ((user.atk + user.mat + user.agi) / 2000), actors who have either strength or magic would be at a disadvantage to enemies who possess both Strength and Magic.

What I'm wanting to accomplish is a possible Hit rate formula that balances it out among all of my actors, regardless if they have either Strength or Magic or both.

-If some actors have just Strength, the formula would just use the actor's strength with the speed.
On a side note, they can still access weapons that can do magic damage (based on assigned Skill ID), so that would use the Magic instead of Speed in the formula.

-If some actors have just Magic, the formula would just use the actor's magic with speed.

-And for actors that have both Strength and Magic, the formula would use either one along with speed based on what type of skill they're using.

In regards to the three points, I mean if they have a skill that does physical damage, use the Strength with Speed in the formula, but if they have a skill does magical damage, use the Magic with Speed in the formula instead.

That way, each actor won't have a advantage like that among one another. Would any if-else statements be possible to manage this? If so, what formula do you think would work with this?
Sadly, the 'hit rate' attribute of an actor cannot be based on the skill used. This is because the 'hit rate' attribute is calculated without any skill input (ie you can see it from the menu, just like atk or mat, so it cannot be based on a skill since there is none). Instead, if you use Yanfly's Hit Accuracy plugin, then you can use different stats to alter whether the skill will hit or not and not have to base it solely on hit rate.

On a side note, the best I can come up with from the Extra Param Formula alone is this:

Code:
(base + plus) * rate + flat + ((Math.max(user.atk, user.mat) + user.agi) / 2000)

It'll factor in both the actor's atk and mat, and use whichever is higher, not exactly what you're trying to do, but I would assume a bit better. Try Yanfly's Hit Accuracy plugin to see if you can get better results with that.
On Yanfly's Hit Accuracy, I do have both Physical and Magical action set to user.hit.

I did change SkillHitRate * (userHitRate - targetEvadeRate) to userHitRate - targetEvadeRate, because I think hit rate should apply to them as well. I'm not sure at the moment if I should go back to the former and stick with this one, but I'll look into some more into Hit Accuracy. (Also, don't know why in few cases, they dodge certain hit actions).

And I may go ahead and stick with this formula. And like you said, it'll use either atk or mat based on which is higher. Would this also apply to using skills with damage formulas such as a.mat * 2 - b.def?
------------------------------------------------------------------------------------------------------------------
For example: Actor 1 has 300 atk and 200 mat (including equipped weapon) but with this formula, atk is used when an attack is initiated.

But Actor 1 uses a skill that multiplies magic by 2, meaning 400 mat so that would mean mat from the formula would be used since it's higher. Am I right on this one? Would multipliers like that also be applied to (base + plus) * rate + flat + ((Math.max(user.atk, user, mat) + user.agi) / 2000)
On Yanfly's Hit Accuracy, I have "user.hit + a.atk" for physical actions and "user.hit + a.mat" for magical actions.

And on the Extra Param Formula, it's now (base + plus) * rate + flat + ((user.agi) / 2000).

Is this good enough?

Original thread: https://forums.rpgmakerweb.com/threads/yep_extraparamformula-hit-rate-formula-atk-or-mat-or-both.82816/