Remove Random State on Hit?

Hello! \(´ ▽`)

I'm looking to implement an ability that follows as such:

Deals damage -> Removes a random (beneficial) state affecting the target, checks the ID of the state that was removed, and then based on that ID, inflicts a different state (that prevents that specific beneficial state from being applied again for 3 turns)

I saw something sort of similar-ish in another thread here: https://forums.rpgmakerweb.com/index.php?threads/remove-random-status-effect.74282/

. . . but it was for MV and I'm not sure how I would properly implement it into Ace. If anyone is able to help out, it would be greatly appreciated! @_@

Original thread: https://forums.rpgmakerweb.com/threads/remove-random-state-on-hit.87566/