I'm not a coder so I'm not sure how hard to code my proposal will be but would it be possible to allow units to move back on the battlefield? Make it a setting so that cavalry can charge, withdraw and charge again or so that archers can move away from combat.