Priming more then retraction does not really solve the problem. Most likely this material you "lost" is ending up somewhere else, which is what you might want to address. Print temperature could be a huge influence here, so you might want to print cooler.
I can't write a plugin for you, but I do suggest that you try tweaking the "minimum layer time" setting.
Link to post
Share on other sites