If you don't have a terrain lightmap, I would use the lightmap technique because it already does what you want, multiply all detail textures with the lightmap texture. You just need to define the terrain base skin as a bmap, and then copy it into the terrain lightmap pointer

my.lightmap = baseskin_bmap;

Then you dont need to modify the shader. At least thats the general idea - haven't tried it but might be worth a try.