how can i limit users according to amount of download ?

Hi everybody,
I thanks AYcoo posted the code below. It worked well.
However, I would like test tx-rate+rx rate of active users. If tx-rate+rx rate >10m, this user will put slow profile.
What code can I do that?
Please help me! Thanks a lot for any guide.
Thanks, Thanks, Thanks…