Refactor history score calculation
Passed STC:
https://tests.stockfishchess.org/tests/view/65ad08b179aa8af82b979dd1
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 161376 W: 41582 L: 41498 D: 78296
Ptnml(0-2): 633, 19354, 40611, 19476, 614
Passed LTC:
https://tests.stockfishchess.org/tests/view/65af966fc865510db026c0f0
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 116526 W: 29269 L: 29143 D: 58114
Ptnml(0-2): 71, 13252, 31509, 13342, 89
closes https://github.com/official-stockfish/Stockfish/pull/5006
Bench: 1317504