How to make this code shorter using an AFL function

You want to count Higher Highs from the source array(cutoff) in this code.

The closest might be this, a relatively new function though over a year ago.
AFL Function Reference - BARSSINCECOMPARE (amibroker.com)

countClosedWithinTopRange = BarsSinceCompare( H, ">", cutoffPriceNearTop );

discussed here