Is there a way to set up a formula to use the higher value between a.atk and a.mat?

I have a troop that is the main character's favorite monster that is randomly encountered in two areas. The monster is Gasdragon from Tecmo Secret of the Stars but the battler PNG is one an artist drew me of that monster. Anyway, if the main character is in the party, as soon as you encounter this monster, the character will say that he refuses to fight his favorite monster and the battle aborts.

There is a variable counting how many times you encounter this monster and when it reaches 75 (you won't get to 75 just doing the story unless you grind it out), this monster will appear as a map sprite in one of the two areas inviting the party to their sanctuary when you talk to her.

Long story short, there are some things that you can buy from these monsters in that sanctuary, and one of them is an item that acts as their signature move, blowing gas from their mouth.

The skill for this is attack has a formula "a.mat * 4 - b.mdf * 2" However, I want the item to be effective no matter who uses the item and the majority of the party are physical attackers. Technically it is closer to 50/50 but not exactly. Justin and Damian are physical, Arron is magical, and the dragon is basically a jack of both but her physical is a little bit stronger.

I want the item to be that same formula as the skill but instead it uses the bigger attack stat. Meaning for Arron, it will use a.mat whereas the others, it will use a.atk.

Is there a way to do this in formula?
[a.mat, a.atk].max * 4 - b.mdf * 2
?

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-set-up-a-formula-to-use-the-higher-value-between-a-atk-and-a-mat.160856/