Using IF function in FACET

Hi all, since it is not possible (i think) use conditions for FACET, i’m thinking of using udf for query, where i can apply all conditions and return computed values.
But i have encountered another obstacle.
From docs i read that i cannot return MVA or json https://manual.manticoresearch.com/UDFs_and_Plugins/UDF#Return-types-of-UDF
So FACET will not count values like [2,4,7], that i want to return.
Or is the documentation old and i can return MVA for using in FACET function?

For your idea how the json fields looks like

"variants": [
        {
            "attrib_1": 1,
            "attrib_5": 23,
            "availability": 6
        },
        {
            "attrib_1": 17,
            "attrib_5": 21,
            "availability": 4
        },
        {
            "attrib_1": 17,
            "attrib_5": 22,
            "availability": 2
        },
        {
            "attrib_5": 24,
            "availability": 8
        },
        {
            "attrib_1": 1,
            "attrib_5": 22,
            "availability": 6
        }
    ]

The udf function should return all values for attrib_5, but only for those variants where attrib_1 is 1 or 17 for example.

So my only option is to use some plugin or udf.