Yanfly Extra Param Formula - Conditional Hit Rate

Hello there.

With Yanfly's Extra Param Formula, I'm using this Hit Rate formula (provided below) that factors both ATK and MAT, but it only uses which stat is higher per user regardless of what type of skill.

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

But this isn't what I'm trying to achieve. What I'm trying to aim is that if the user is using a magic skill (not weapon), then the magic stat should be used else by default, only the attack stat would be used.

Someone said an if statement can be possible on this Hit Rate formula. Does anyone know of an "if" conditional statement based on this formula where it uses either ATK if it's a physical skill or MAT if it's magic skill? Any help would be appreciated.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-extra-param-formula-conditional-hit-rate.84873/