Your static_cast isn't doing anything. What you should be doing is:
if(static_cast<int>(maxTotal) % 2 == 1)
Variables in C++ cannot change types. Static cast returns the casted value it does not change the input variable's type, so you have to use it directly or assign it.
int iMaxTotal = static_cast<int>(maxTotal);
if(iMaxTotal % 2 == 1)
addCalc = minTotal;
else
addCalc = 0;
This would work too.