Do you have a group inserted on {@time}? If so, then your formula should be:
if {BIN_COUNT.BIN_CNT} >= PthPercentile (80,{BIN_COUNT.BIN_CNT}, {@Time}) then crRed else crBlack
For topN, you can add the special field groupnumber to your group header/footer and then use a formula like:
if groupnumber <= N then crRed else crBlack //where N=your topN value
Or instead of groupnumber you can use a running total that resets on change of group.
-LB