Thanks, it was something like this I needed
Your code makes sure, that values are included right away. Can't believe what a mess I ventured into with the other code (which I took over from a far-range fadeout of instancing with too little tthought).
Just for the record, the final shader code will look like this:
float l_dissolvemap_result = tex2D(g_dissolvemap_sampler, a_texcoord0).r; if(g_alpha < l_dissolvemap_result) discard; l_final_color.a = l_original_alpha;
In this way alpha-testing (or alpha-to-coverage, which is very similar, just with nicer edges and antialiasing) will still work for the original alpha of the object texture, as the g_alpha is not factored in.