When an object is pinned, you can get the UID of the object it is pinned to using the PinnedUID expression.
So when you want to destroy a monster, before destroying it, pick textbox by UID where the UID is equal to monster.Pin.PinnedUID. Destroy the textbox, then you can destroy the moster