What Hank is talking about sounds fairly close to the mechanism in the Panzer Campaigns/Modern Campaigns/ First World War Campaigns series - where it does pretty much how he explained.
What Patrick mentioned also is how those other series use fatigue as well as morale - so programming-wise, the code would exist.
The complication comes in to play in that the programmer, John Tiller, takes his lead from his scenario designers who have to prioritize their engine change requests. Mr Tiller makes his money from doing programming from his military contracts; which normally are unrelated to 19th century (and prior) warfare.
For example, Squad Battles uses another mechanism that would make for some potentially interesting scenarios -where the VP's for VP hexes are tallied up for each turn that a side holds it -leaving the possibility of having uncontrolled vp hexes. Also, I think that series uses a mechanism that varies the actual amount of turns in a scenario a bit. It would say (for example) a scenario has 16 turns - but has an x% chance of ending before, on, or after that turn which isn't disclosed.
Anyways - just my 2 cents.
Col Stephen Trauth
3/XV/AotT
Specializing in Equestrian Deep Insertion Infrastructure Destruction
or if you want: Dirty Deeds Done Dirt Cheap