#JavaScript (ES6), 106 104 bytes
Saved 2 bytes thanks to @Shaggy
a=>a.filter(n=>n,[...a].map((v,i)=>a[a[p>v&(n=~~a[i+1])<p?i-++k:i+(k=0,n>v&p<n)]+=x=a[i],p=v,i]-=x,p=0))
#JavaScript (ES6), 106 104 bytes
Saved 2 bytes thanks to @Shaggy
a=>a.filter(n=>n,[...a].map((v,i)=>a[a[p>v&(n=~~a[i+1])<p?i-++k:i+(k=0,n>v&p<n)]+=x=a[i],p=v,i]-=x,p=0))