Fixes Bug 2031 and Partially Fixes 2094

There is a significant amount of code duplication here. Ideally we want to move the content of the if body into a separate helper function (remember that you also can address a dynamic stat like health or magicka via its index). This will be particularly useful once we start to de-hardcode the dynamic stats.