Cancel state only by physical damage

Hello. Can someone help me?

I use RMVXA. As usual, under Database > States, under the removal conditions, you can specify whether the state can be removed by damage or not. Turning the condition ON causes any type of damage (physical/magical) to break the condition.

In short: I want to ONLY remove a condition from physical damage, such as sleep or confusion.

Is there a formula, script or general way that this works?

Thank you very much in advance! ; )
I finished working on a script. Just wait for the moderators to approve it.

Original thread: https://forums.rpgmakerweb.com/threads/cancel-state-only-by-physical-damage.158779/