I’m afraid I don’t have an easy solution. I think most modern fonts that allow “stacked up” characters, contain OpenType features like glyph substitution (in the GPOS table). This topic explains how to add such features to your font with help of the OpenType Compiler:
Adding OpenType features
Another post, but IMO less relevant is: