Blending the brightness of two bitmapdatas

I really need to know, specifically, how to overlay one bitmapdata onto another, using the hue and saturation of the top bitmapdata, and blending the brightness of the two layers. ColorMatrix gets me close but can only affect one bitmapdata, not blend between two. Also, the overlay effects do not allow me to blend in this very specific way.

PLEASE HELP!