After a decade of work experience I'm nearing my 30s and I've realized I always project my abandonment issues into my employer, which leads me to testing my employer multiple times through my erratic behaviour ("if I do something bad and my employer doesn't punishes me it means I'm accepted" mentality) which always leads me to getting into trouble.

How can I stop doing this? Only recently I started paying attention to my mental health. Also I'm a male, so my erratic behaviour is considerably more agressive instead of just being passive agressive. This gets in the way because I'm no longer in low ranking positions, I'm expected to lead now. An insecure and crazy leader can't lead at all. 

BPD is not my only diagnosis but it's probably the most pervasive disease I have that leaks into my job. Last time I got fired they almost had to call police in me, I manipulated my boss into paying for my taxi fare and I almost attacked him and another guard. At the same time I tried to kill the previous day and the following day, ended up binging self-harm, relapsed back to 24/7 drug use for months. I really want to improve my life quality because things will only get worse.