Aggregating on minimum value field

I'm looking for a way to run terms aggregation on term fields having a count of at least x.
Note that I'm not trying to exclude terms that had below minimum amounts of hits(min_doc_count), but I'm trying to Aggregate only values that are bigger then x.

Is this kind of thing possible? Perhaps using a script?