Clear[P1, P2, B1, B2, P3, B3] Clear[P1comb, P2comb, B1comb, B2comb, P3comb, B3comb] a = {P1, P2, B1, B2, P3, B3}; b = {P1comb, P2comb, B1comb, B2comb, P3comb, B3comb}; Using lower-case count initially, to be replaced with Count
Array[With[{c = b[[#]]}, c = f[a[[#]]] - count[Take[a, # - 1], a[[#]]]] &, Length[a]] Examples
P1comb -count[{}, P1] + f[P1]
B3comb -count[{P1, P2, B1, B2, P3}, B3] + f[B3]
Assigning values after symbolic construction.
With[{d = a}, d = {1, 2, 3, 4, 3, 2}]; B2 4
B3combb /. count -> Count {f[1], f[2], f[3], f[4], -1 + f[3], -1 + f[2]}