Having Defend Restore HP or MP Conditionally

As the title says, I want to have defending have an effect of restoring a small amount of hp or mp, depending on whether the character is a magic user or uses weapons. I figure I need to make a custom formula, but I'm not really sure on how I would check if the particular person using the skill is physical or magical.
Make two different defend skills and change them in the specific actors battle command list. Yanfly has one.
Make two different defend skills and change them in the specific actors battle command list. Yanfly has one.
Wait..is that it? I thought there'd be a way to do it via the damage formula. I guess I was too ambitious, haha.
Thank you then.

Original thread: https://forums.rpgmakerweb.com/threads/having-defend-restore-hp-or-mp-conditionally.35307/