After searching for a few hours I am trying to get help here.
I can see it manually in Histogram panel and selecting "Selected layer" (I translated this name from my polish Photoshop so english may differ), but could not find any code snippets even reading scripting guide or js ref - pdfs.