I've been trying to solve this problem for a very long time, but I've only ever come up with partial solutions.
I'm trying to do the following—please use the example rig in the attatched file to follow along. The bones (from top to bottom) are "Head, Neck, Torso, Base." Head and Torso are parented to Base, Neck is parented to Torso.
I'd like bone "neck" to rotate on its local Y axis as bone "head" rotates on its local Y axis, regardless of what other rotations on other axes bone "head" may possess. I'd like this to work even if bone "torso" or "base" are rotated as well—this is the part I get tripped up on. In whatever setups I've managed to create, rotating the bone "base/torso" makes the neck rotate too much, creating annoying artifacts.
Could somebody please present me with a solution to this troubling dilemma?