The way the different types of damage interact with the different types of armour is hard-coded.
One way to work around this is to mod all (or most) statuses to be blocked by Magical armour, mod all skills to apply a status that does Corrosive damage on application, but is blocked by magical armour and a status that does the desired 'final' type of damage but is blocked by physical armour, and have all skills do Magic damage.
This way, when a skill impacts:
- If the target has Magical Armour, that armour soaks up the default Magic damage.
- If that breaks the Magical Armour, this will allow your Corrosive status to pass, which does damage to the physical armour. Otherwise, that status is blocked and physical armour remains.
- If that breaks the Physical armour, the secondary damage status also passes, which, in turn, does e.g. Fire damage or Physical or whatever else you want the skill's final damage type to be.