Don't know if you knew about Kollectiv's
Overhead addon. One of it's main features is the functionality you're looking at. You could check that out for reference. I've also been wanting to add this to my own addon but haven't gotten started on it yet.