How to get or set property via a touch sensor?

For get item or calc damage received, I need get or set property value from touched object. Don’t know how to function the sensor in python, any example here?

if sense.isPositive(): sense.getHitObject().someProp -= 20

Thank you, I got it work now