Mqtt Publish script help

Is it possible to script so that the machine number changes dynamically according to a defined custom property.
I am using tag event scripts to publish the value of the tag to a mqtt topic:
system.cirruslink.engine.publish(" Chariot", “MA1/Probes/CH1LowSPSub”, str(currentValue).encode(), 0, 0)

MA1 represents the machine number to be sent to. I need to script so that the 1 changes/follow according to the custom property number.