I'd like to create the same function too. Alas I'm still new to modding this game so I don't know how you could implement it.