Simultaneous Status Add/Removals (Gen I Wrap)

So for one of the boss battles in my game, I want to have the boss have a move that inflicts damage on the opponent, then inflicts a state on both the boss and the target where both can't move, and the target takes damage each turn. This lasts for a few turns, then both the boss and the target are free from the state simultaneously. I namely want to know how in this case how to add and/or remove states from both sides. I know how to put them onto one side, but not the other. Thanks a lot in advance!
You can do this in the damage formula box:

Code:
a.addState(stateId) ; 'damage formula goes here'

It's probably worth giving this a read for further information on how you can use the damage formula box: https://forums.rpgmakerweb.com/index.php?threads/damage-formulas-101.81905/

Original thread: https://forums.rpgmakerweb.com/threads/simultaneous-status-add-removals-gen-i-wrap.93773/