If you read the legend syntax, you should be looking at something like:
\l(1, AB0) %(1)
\l(1, AB1) %(1, @v"below")
It's just a long text. You can parse it by row to do string manipulations (delete the row if there is a "below" in it, for example), create your own legend text string, and overwrite the original one.