hm there's a couple ways depending on what kind of endless you mean--you could have it loop back around to battle_start or take out the part where knocking the characters' hp down to 0 jumps to battle_win/lose. that's where i would start! i imagine it'd need quite a few adjustments to become the kind of game you're thinking of though haha