Well, you can also do it this way. To change an object variable in object B, in the object A trigger machine, just add in the change variable node, set variable origin to Object, type in the variable you want to change into the variable key, and in the object section, just put in starting object.
The starting object is whatever object that collides with object A. So whether it's object B or Z, the moment it collides with object A, that object will be the starting object. Of course, the limitation of such method you want is that all object variables of the gameobject A to Z must have the same object variable name.
If they are different, you will have to do it the long way, and in the object A trigger machine, you will have to add in the check object name node, and changing their respective object variables upon success.