Stat Swap status ailment?

Like the title says, I want to know if there's a script there that allows an ailment to have the temporary effect of swapping a player's ATK with DEF in battle.
Code:
class Game_Battler
  alias :ori_atk :atk
  alias :ori_def :def
  def atk
    return ori_def if state?(<PUT STATE ID HERE>)
    return ori_atk
  end

  def def
    return ori_atk if state?(<PUT STATE ID HERE>)
    return ori_def
  end
end
May not displayed in the status screen. But it may work in the damage formula
Code:
class Game_Battler
  alias :ori_atk :atk
  alias :ori_def :def
  def atk
    return ori_def if state?(<PUT STATE ID HERE>)
    return ori_atk
  end

  def def
    return ori_atk if state?(<PUT STATE ID HERE>)
    return ori_def
  end
end
May not displayed in the status screen. But it may work in the damage formula
Thank you!
Finally got the effect to work.

Original thread: https://forums.rpgmakerweb.com/threads/stat-swap-status-ailment.104830/