Edit

Molang Documentation - minecraft:query_skin_id

Returns the entity's skin ID (related to the skin_id component).