How to create "On Drop" function on an item so that this item can awso later recognize what exactly is dropped on it (for crafting) ?

Add a variable called CurrentHeldItem(or whatever name you like), then on click put the class or name or some kind of identifier from the item you are holding into it. When you release the RMB and drop it on top of the other one, check what’s inside CurrentHeldItem and use that anywhere necessary.