YEP Battle A.İ Help

Hi there,I'm trying to write A.İ to an enemy.How to do something like this:
Think of a skill called ''Destroy''. The enemy normally does it at any random target.But if a target has physical weakness, it targets it.İs there any way to do that?This would be very good in general. Both the enemy would be clever and there would be no restrictions for skill use.

Original thread: https://forums.rpgmakerweb.com/threads/yep-battle-a-i-help.110062/