Retreat to safe area for life or energy shield recharge

Implement a feature the will retreat character to monster free area when energy shield or life is below a certain amount above the life and energy shield chicken till the characters life or energy shield replenishes to a safe amount to go back and reengage in fight. If character gets hard struck and shoots below the amount too much it will engage life chicken so you can manually save the character as it does now. Would save on continually having to watch bot during mapping if it had a retreat feature. Would also help when character is standing too long in fire cold shocked or poisioned ground while engaged in battle.