I think I have a solution for you which appears to work when I tested it. Set up your race series with four races and then name them as handicap 1, handicap 2, handicap 3 and pursuit. Now make handicap 1, handicap 2 and pursuit non-discardable. Set the discard profile to 0,0,1. If a race is non run then simply don’t enter any codes or scores against the competitors for that race. When you score the series handicap 3 will only be discarded if all 3 handicap races have results/codes entered against them irrespective of whether the pursuit race happens. If two or less handicap races are run then no discards will occur. This seems to fulfil the varies combinations that you’ve outlined. This may not be the most elegant solution but it seems to do the job.
Good luck at the weekend.