How to combine compositor render passes from 2 types to get only one?
What you normally do when you combine passes is to add indirect pass with direct pass and then multiply with the color, then do the same with the other type of passes and add them together, so:

Composite = Xcolor * (Xind + XDir) + Ycolor * (Yind + YDir)

now you want to separate Composite in Zcolor * (Zind + ZDir), then:

Zcolor * (Zind + ZDir) = Xcolor * (Xind + XDir) + Ycolor * (Yind + YDir)

There are 3 unknowns for one equation, therefore you have to assume more relationships for the unknowns, I chose these because they give good results:

Zind = Xind + Yind

ZDir = XDir + YDir

with these relationships Zcolor can be solved to

Zcolor = Composite/(Zind + ZDir)

This is the node setup.