I actually do something similar to this already, using an app called QualityTime for Android. It sends a datapoint through IFTTT when my phone use goes over a given amount of time for the day. QualityTime can also send the number of phone unlocks to IFTTT, I think, which may be useful to you. The datapoint goes to a do less goal with a slope of three units per week, which allows me to go over my allotted time three days a week, and I will gradually tighten down the number of days off and/or the time limit as I get better at it. It has had an enormous impact on my phone usage.
QualityTime does allow you to set up limits on a per-app basis, but it doesn't let you send those to IFTTT. Tasker might work for that.
Also: I expected that my setup would need to distinguish between legit and non-legit use in order to be effective, but it turned out to be completely unnecessary. I'd try a simple setup first and see if it works before putting a lot of time into it.