I think you have a lot more going on than is necessary, especially the joins and subsearches and chart/stats. I don't have a way to test this so I don't know if it's quite correct but I thin its close?
index=thing sourcetype=thing name=thing earliest=-60d latest=-7d
| bucket _time span=1mon
| dedup host-ip plugin_family plugin_name host-ip ports{}.port ports{}.protocol ports{}.transport
| stats count(eval(severity!=informational) as VH, dc(host-ip) as TH, count by plugin_family, severity, _time
| fillnull critical, high,medium,low
| eval RiskValue=/Formula/
| timechart span=1mon max(RiskValue)
... View more