Help recalculate your rep!

ES6, 104 bytes

s=>s.split`
`.map(l=>(g=U=>[...l].map(c=>(r+=eval(c))>200?r=200:0,r=0)|r,t+=g(10)-g(5)),u=10,d=-2,t=0)|t

Calculates the before and after rep for each line. My first use of eval!


Haskell, 98 93 bytes

Thanks to BlackCap to golf this further. Now, I think to try lambda in later challenges, now.

x#'U'=x
_#'u'=10
_#'d'=(-2)
a&b=foldl1(\d g->min 200$d+a#g)
g=sum.map(\x->(10&x)-(5&x)).lines

The first 3 lines is the scoring, a&b is is the score, f is the difference and the g is the function sastifying the specification.

Usage:

g"UUUuuuuuUUUuuUUUUUUuuuUUUuuUUUUuuuuUUUdddddddUU" -- 4