Couple of years ago(4-8y) I played a browser game where you could program how a combat should be played by your character. E.g. use potion if you have less than 50% hp. Combat encounters were somewhat similar to pokemon games(you move on a map and sometimes combat happens, not sure if enemies were shown on the map). Setting was fantasy of course.
dragon age origin, you can program the ai of your companions, but you can also pause the game and give commands so use that information as you will
Hmm, might have been an Edgebee game: Sorcery Quest -- If it is, the site went down around April 2018.