EDIT: Yes, when they are attacked there should be a chance (maybe something high, like 40-60%) they can escape the attack, if that is possible.
I can't get them withdraw at the moment, but rest of the code is ready. It's again nearly midnight here. I'll try to get it work tomorrow.
You can't do that in normal game, so I have to write some python code. But somehow my computer doesn't want to do anything corectly when I should be sleeping.