Offcourse there is a way to solve this problem.
You would have to writte 2 different kind of bots. The first one (higher lvl)
has to attack the mobs as usual (normal bot 369) and the other char (lower lvl) has to follow him and track his hp and magic barrier, if hp too low or magic bagic barrir is off then he would to reactivate it again. If u want that the second char (lower one) attacks too, then u would have to run the bot on the same pc to track the monster id your higher char attacks.
But i think you would have to solve your problem on your own, cause i think its an ividual problem and noone is interested to program this bot for you.
Anyway gl!