It must be hardcoded. The game does store that info somewhere, but it is not accessible or moddable by us. I've read somewhere that officers have 2hps and generals have 7, but it's impossible to test-prove it.