Help creating a DEF & MDF swap skill

Hey everyone. Thanks for your help in advance.

I'm currently making a class that has a character use his or her magic to attack with physical damage. This way they can have attributes to their attack like Fire or Ice, but have it still be a physical attack. I have the class almost complete, but I know there will be situations in my game where this person will have to fight high DEF enemies that will require strong magic attack to take out. I want to create a skill that (for 2 turns or something) flips the opponent's DEF with their MDF. This way the physical attacks can do a lot of damage to a high DEF opponent for a couple turns. Can someone help me out with this? I haven't been able to figure it out.

Thanks again. 🙂
I'm not sure if there may be a script way of doing so, but in the vanilla VX Ace Database, I did the following

State: Flipped

Parameter - DEF * 25%

Parameter - MDF *100%

Auto-Removal Timing @ Turn End, 2 turns.

It won't do an exact flip of the monster's DEF & MDF. If I'm thiking about this the right way, you're trading doubled Magic Defense to give the opponent a huge reduction in DEF. This should also give your Melee characters a huge buff too, not just this unique user.

Skill: Flip (you can call it whatever you want, obviously)

Effects: Add State - Flipped @ 100% accuracy

Hope this helped!
It's not exactly what I wanted and if possible I hope that I'll find a way to do it the way I wanted it done, but in the meantime this is a very good fix and a huge help. 🙂 I really appreciate your effort in this. 🙂
I thought about it for a bit and I think I may have come up with something that fits more to your original idea.

My workflow

Common Events

Flipped? / Trigger: Autorun / Switch: Flipped (make a switch for this)

Make 3 Variables. I named them:

MobMDFplaceholder

MobMDF

MobDEF

Contents:

Control Variables: MobMDFplaceholder, Set, Game Data (Enemy 1. 's MDF)

Control Variables MobMDF, Set, Game Data (Enemy 1. 's DEF)

Control Variables MobDEF, Set, Variable MobMDFplaceholder.

If I'm thinking about it right, it sets the Magic Defense to a place holder, changes the Magic Defense to the Defense Stat, then uses the Placeholder to set the new Defense stat.

In your Flip skill,

Effects - Kind, Common Event, [what you named it].

I don't have the ability to playtest this for myself, let me know if that works.

Edit 1: Sorry, just realized that may be incomplete. Let me look at it a bit more. All I did was tell it to do variable changes...

Edit 2: Okay, I can't find a way to make the database set the monster's DEF and MDF using the variables. It looks like there might be a way to do that via scripting. Unfortunately I have exactly 0% knowledge in programming for Ruby right now. This is about as far as I can take you right now.
I'm not able to test it right now. But I will definitely get back to you. 🙂 It makes logical sense the way you explained it, so I don't see why it wouldn't work. We'll find out. 🙂 Thanks again! You're great.
Just a friendly suggestion now. You may want to reconsider this ability. While I don't know how you're setting up your game, the math and formulas involved and all that, this ability seems a touch overpowered.

Basically, any fight where a high DEF / low MDF monster gets hit with this ability is going to be turned into a glass cannon. Any debuff on a monster can be considered a party wide buff. When this ability gets used, all your physical attackers' attacks are going to go through the roof. Boss fights will be child's play. What you may want to consider instead is simply buffing the actor using the ability to have an increased ATK for a few rounds to compensate for it's seemingly low base ATK.

Alternatively, you may want to try to find a way where this ability can't be used infinitely in battle.

Just some other ideas that popped into my head. Sorry again about the variable method not working (see 2nd reply). If I discover a way to do it I'll let you know, unless someone else beats me to it.
I actually have a skill for one of my characters similar to your revised suggestion.  In my case the user has increased MAT as a swap for a lower DEF for 3 turns.  This works well so far, and avoids the problem you've identified.

Original thread: https://forums.rpgmakerweb.com/threads/help-creating-a-def-mdf-swap-skill.15859/