I have no idea what a "lookback" period would be used for in something like this so I will just invert the solution you referenced in your question so that it computes the percentage of down months instead of the percentage of up months:
input threshold = 75.0;
input monthNumber = 1;
def targetMonth = GetMonth() == monthNumber;
def downBar = close < open; def markDownMonths = if targetMonth then downBar else 0;
rec countTargetMonths = if targetMonth then countTargetMonths[1] + 1 else countTargetMonths[1];
rec countDownMonths = if markDownMonths then countDownMonths[1] + 1 else countDownMonths[1];
def keyMetric = 100 * (countDownMonths / countTargetMonths); plot scan = keyMetric > threshold;