I would:
1. Create a custom loot table that contains an item with a specific nbt tag and has the "killed_by_player" condition (
This is a good site for making loot tables)
2. Have the custom mob use the loot table (using the {DeathLootTable:""} tag)
3.
Have a command constantly checking for the item entity with the specific nbt tag4. If it finds the item (meaning a player killed the custom mob and it dropped the item), execute at the item entity and tag all players in a certain distance of it
5. Run any other commands needed, then kill the item entity
This should work in theory, I haven't tested it though.