This did the trick:
shader.fragmentShader = shader.fragmentShader.replace(
'#include <alphamap_fragment>',
`
#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vGridUv ).g;
#endif
`
);
You can see it implemented here.