You can, you just have to make sure the other module really gets loaded, or the bot will crash with an error ("Illegal function call" or something like that).
It works for functions, not sure what the rule for variables in objects is in PHP.
You could try adding a function that returns your wanted value, instead of trying to access the variable directly. Not sure if it will help with your problem though.