When programming variables should not change unless they are explicitly told to do so. As such a variable can only be changed with an = operator. There are a few exceptions to this rule but I can’t think of any to worry about in the BGE.
The operation you wrote does the arithmetic but doesn’t put it anywhere. The code for the operation you want is:
owner[‘health’] = owner[‘health’] - 1
Due to the redundancy in the code most programming languages support a shorthand version of this:
owner[‘health’] -= 1
This is basic programming not specific to the BGE. I would recommend that you find and read a good python tutorial as it will make everything a lot easier.
“owner[‘health’] - 1” does not and should not change the value of ‘health’. It is a mathematical expression that returns a numeric value, the value of ‘health’ - 1. It does not imply any assignment, you must perform the assignment yourself.
Has multiple atomar operations. You see them when writing it differently:
currentHealth = owner["health"]
#1: read container owner store value in an implizit variable
#2: create variable currentHealth
#3: assign result of 1 to variable of currentHealth
damageFromBullet = bullet["damage"]
armory = owner["armory"]
damageThroughArmory = damageFromBullet * armory
damagedHealth = currentHealth - damageThroughArmory
owner["health"] = damagedHealth # Add/Replace item with key "health" in container and value damagedHealth
This code seems longer but it does the same as the code above. The code above does not show the implizit variables.
Btw. It is not the goal of a good programmer to write code that is as short as possible. A professional programmer writes code that is as readable as possible.