I'd have to pick the scripting apart if I still have it, but it seems to me I did this in a script on a giant deathclaw in Path of the Gunslinger to see if the player had a certain gun equipped...but then again I'm not sure if I called the exact object reference or just the base ID.
If nobody else answers you satisfactorily, lemme know and I'll hunt down that script if I can and poke at it with a sharp stick.