Right now, one can neither select a scripted field as the target of an aggregation nor supply a custom script in combination with a special aggregation in the time series visual builder, as far as I see. Is that correct?

I have a use case where I need to compute several bucket script aggregations over simple aggregations, which themselves are scripted. For example: I need to compute a sum of the form sum(f(x)), where f(x) = x, if y = 0 and f(x) = 0 else (x, y are document fields). Generally I have an ES query which computes exactly this value. Nevertheless it seems that I am not able to visualize this in Kibana.

Is there any way I can use a scripted aggregation (e.g. scripted sum aggregation) as a child aggregation of a bucket script aggregation in Kibana?

Unfortunately I am not in a situation to alter the type in order to include an according precomputed field.