Keep 'overlay' attributes when merging/flattening?

I might be missing it somewhere, but I’ve googled this to death any can’t find anything. Is there a way to merge or flatten layers, or even just export an image while keeping the layer attributes? For example, if I have a green dithered square and have a red ‘overlay’ layer, it should now be a red dithered square. But when I merge or flatten or export, it just changed the overlay layer into a normal layer and I lose those attributes. I end up with a plain red square as my output.