Thanks! Masking (that custom spec input) by shadows is part of what the custom BSDF (in this case the extended SLW BSDF) does. There’s no way to do it just via material graph, unfortunately, which was always a point of frustration for me. So I wanted to add something that could do something similar.
In this case, it’s just taking that input, and masking it by the lighting. You can see where this happens for SLW in ForwardLightCommon.ush, line 256 (https://github.com/EpicGames/UnrealEngine/commit/df79152eac7bb114009496f8b29931d4833b12c3)