|wow, what a gordian knot, Lol! I've never encountered code as convoluted as this. No offense, there's some neat ideas and potential for creativity therein, but i don't see how it could ever work for the simple task you've undertaken.|
Here's the dummy's (ie: me, not you) version:
set /a hp+=20
if %hp% geq %hpmax% goto :eof
or, one-liner version:
for /L %%a in (50 20 %hpmax%) do echo %%a
but you might have very good reasons for wanting to try to code it as you did, so i may be way out in left field. Maybe followup posts will reveal the mysteries...