First thing was to make danger score available to search. I was already returning game phase from search, so I added a struct to hold more things. Things has to be done due to TT score and material hash, but anyway.
The way I use danger then is simple. I define boolean/factors comparing danger[cur_player] and danger[opponent] to some margins.
One for tweaking pruning, another for reduction.
For pruning of bad caps, I changed the usual SEE < -100*depth to SEE < -factor*100*depth so that if danger is high I try more exchange/sacrify
For reduction, I only do --reduction if danger is too high.
Danger thresholds for those is quite tricky to tune.
The main idea was that :
1°) Minic was not able to find deep mate involving sacrify
2°) Minic was not able to defend against strong quick attack involving sacrify
I guess there is still place for improvement. USe own danger and opponent danger more wisely for a start.
It is helpful ?