Sorry for the delay here. I must have missed your question initially.
Based on the information given, you cloud change rule A to a direct call rule that is called by the custom code section of rule B. That way, rule A would only fire when rule B fires. There may be other ways of accomplishing this, but I would like to understand your use case better before suggesting anything further.